<html>
<head>
<title>Wii Transfer</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/bundle/sharing.css" type="text/css" />
<script src="/bundle/prototype.js" type="text/javascript"></script>
</head>
<body>

<script language="javascript">

var t = setTimeout ('checkConversion()', 6000);

function checkConversion ()
{
	track_info_path = document.test_form.track_info_path.value;

	new Ajax.Request(track_info_path, 
		{
			method: 'get', 
			onSuccess: function (transport) {
				if (transport.responseText.match(/ready/)) {
					window.location.reload();
				}
				else if (transport.responseText.match(/error/)) {
					Element.update ('content_progress', 'An error occurred while processing the AAC file. Please check that the song file is valid and plays correctly in iTunes, then contact Riverfold support for assistance.');
				}
				else {
					t = setTimeout ('checkConversion()', 3000);
				}
			}
		}
	);
}

</script>

<h1>Preparing AAC music file ([song_name])</h1>

<form id="test_form" name="test_form">
<input name="track_info_path" type="hidden" value="/tracks/info/[track_id]" />
</form>

<div align="center" id="content_progress">
<embed src="/bundle/spinner.swf" width="225" height="225" />
</div>

</body>
</html>